Optimal. Leaf size=114 \[ -\cos \left (\frac {\pi -2 k \pi }{n}\right ) \log \left (\left (\frac {a}{b}\right )^{2/n}+x^2-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} x \cos \left (\frac {\pi -2 k \pi }{n}\right )\right )+2 \tan ^{-1}\left (\left (\frac {a}{b}\right )^{-1/n} \left (x-\left (\frac {a}{b}\right )^{\frac {1}{n}} \cos \left (\frac {\pi -2 k \pi }{n}\right )\right ) \csc \left (\frac {\pi -2 k \pi }{n}\right )\right ) \sin \left (\frac {\pi -2 k \pi }{n}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.26, antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 66, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.076, Rules used = {12, 648, 632,
210, 642} \begin {gather*} 2 \sin \left (\frac {\pi -2 \pi k}{n}\right ) \text {ArcTan}\left (\left (\frac {a}{b}\right )^{-1/n} \csc \left (\frac {\pi -2 \pi k}{n}\right ) \left (x-\left (\frac {a}{b}\right )^{\frac {1}{n}} \cos \left (\frac {\pi -2 \pi k}{n}\right )\right )\right )-\cos \left (\frac {\pi -2 \pi k}{n}\right ) \log \left (-2 x \left (\frac {a}{b}\right )^{\frac {1}{n}} \cos \left (\frac {\pi -2 \pi k}{n}\right )+\left (\frac {a}{b}\right )^{2/n}+x^2\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 210
Rule 632
Rule 642
Rule 648
Rubi steps
\begin {align*} \int \frac {2 \left (\left (\frac {a}{b}\right )^{\frac {1}{n}}-x \cos \left (\frac {(-1+2 k) \pi }{n}\right )\right )}{\left (\frac {a}{b}\right )^{2/n}+x^2-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} x \cos \left (\frac {(-1+2 k) \pi }{n}\right )} \, dx &=2 \int \frac {\left (\frac {a}{b}\right )^{\frac {1}{n}}-x \cos \left (\frac {(-1+2 k) \pi }{n}\right )}{\left (\frac {a}{b}\right )^{2/n}+x^2-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} x \cos \left (\frac {(-1+2 k) \pi }{n}\right )} \, dx\\ &=-\left (\cos \left (\frac {(-1+2 k) \pi }{n}\right ) \int \frac {2 x-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} \cos \left (\frac {(-1+2 k) \pi }{n}\right )}{\left (\frac {a}{b}\right )^{2/n}+x^2-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} x \cos \left (\frac {(-1+2 k) \pi }{n}\right )} \, dx\right )+\left (2 \left (\frac {a}{b}\right )^{\frac {1}{n}}-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} \cos ^2\left (\frac {(-1+2 k) \pi }{n}\right )\right ) \int \frac {1}{\left (\frac {a}{b}\right )^{2/n}+x^2-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} x \cos \left (\frac {(-1+2 k) \pi }{n}\right )} \, dx\\ &=-\cos \left (\frac {(1-2 k) \pi }{n}\right ) \log \left (\left (\frac {a}{b}\right )^{2/n}+x^2-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} x \cos \left (\frac {\pi -2 k \pi }{n}\right )\right )+\left (2 \left (-2 \left (\frac {a}{b}\right )^{\frac {1}{n}}+2 \left (\frac {a}{b}\right )^{\frac {1}{n}} \cos ^2\left (\frac {(-1+2 k) \pi }{n}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{-x^2-4 \left (\frac {a}{b}\right )^{2/n} \sin ^2\left (\frac {(1-2 k) \pi }{n}\right )} \, dx,x,2 x-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} \cos \left (\frac {(-1+2 k) \pi }{n}\right )\right )\\ &=-\cos \left (\frac {(1-2 k) \pi }{n}\right ) \log \left (\left (\frac {a}{b}\right )^{2/n}+x^2-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} x \cos \left (\frac {\pi -2 k \pi }{n}\right )\right )+2 \tan ^{-1}\left (\left (\frac {a}{b}\right )^{-1/n} \left (x-\left (\frac {a}{b}\right )^{\frac {1}{n}} \cos \left (\frac {(1-2 k) \pi }{n}\right )\right ) \csc \left (\frac {\pi -2 k \pi }{n}\right )\right ) \csc \left (\frac {\pi -2 k \pi }{n}\right ) \sin ^2\left (\frac {(1-2 k) \pi }{n}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 111, normalized size = 0.97 \begin {gather*} 2 \left (-\frac {1}{2} \cos \left (\frac {(-1+2 k) \pi }{n}\right ) \log \left (\left (\frac {a}{b}\right )^{2/n}+x^2-2 \left (\frac {a}{b}\right )^{\frac {1}{n}} x \cos \left (\frac {(-1+2 k) \pi }{n}\right )\right )+\tan ^{-1}\left (\frac {\left (\left (\frac {a}{b}\right )^{\frac {1}{n}}+x\right ) \tan \left (\frac {(-1+2 k) \pi }{2 n}\right )}{\left (\frac {a}{b}\right )^{\frac {1}{n}}-x}\right ) \sin \left (\frac {(-1+2 k) \pi }{n}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.38, size = 204, normalized size = 1.79
method | result | size |
default | \(-\cos \left (\frac {\pi \left (2 k -1\right )}{n}\right ) \ln \left (2 \left (\frac {a}{b}\right )^{\frac {1}{n}} x \cos \left (\frac {\pi \left (2 k -1\right )}{n}\right )-x^{2}-\left (\frac {a}{b}\right )^{\frac {2}{n}}\right )+\frac {2 \left (\left (\cos ^{2}\left (\frac {\pi \left (2 k -1\right )}{n}\right )\right ) \left (\frac {a}{b}\right )^{\frac {1}{n}}-\left (\frac {a}{b}\right )^{\frac {1}{n}}\right ) \arctan \left (\frac {2 \left (\frac {a}{b}\right )^{\frac {1}{n}} \cos \left (\frac {\pi \left (2 k -1\right )}{n}\right )-2 x}{2 \sqrt {\left (\frac {a}{b}\right )^{\frac {2}{n}}-\left (\frac {a}{b}\right )^{\frac {2}{n}} \left (\cos ^{2}\left (\frac {\pi \left (2 k -1\right )}{n}\right )\right )}}\right )}{\sqrt {\left (\frac {a}{b}\right )^{\frac {2}{n}}-\left (\frac {a}{b}\right )^{\frac {2}{n}} \left (\cos ^{2}\left (\frac {\pi \left (2 k -1\right )}{n}\right )\right )}}\) | \(204\) |
risch | \(\text {Expression too large to display}\) | \(860\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.32, size = 162, normalized size = 1.42 \begin {gather*} -\cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right ) \log \left (-\frac {2 \, {\left (2 \, x \left (\frac {a}{b}\right )^{\left (\frac {1}{n}\right )} \cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right ) - x^{2} - \left (\frac {a}{b}\right )^{\frac {2}{n}}\right )}}{\cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right ) + 1}\right ) - 2 \, \arctan \left (\frac {\left (\frac {a}{b}\right )^{\left (\frac {1}{n}\right )} \cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right ) - x}{\left (\frac {a}{b}\right )^{\left (\frac {1}{n}\right )} \sin \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right )}\right ) \sin \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.56, size = 177, normalized size = 1.55 \begin {gather*} - \left (- \sqrt {\left (\cos {\left (\frac {\pi \left (2 k - 1\right )}{n} \right )} - 1\right ) \left (\cos {\left (\frac {\pi \left (2 k - 1\right )}{n} \right )} + 1\right )} + \cos {\left (\frac {2 \pi k}{n} - \frac {\pi }{n} \right )}\right ) \log {\left (x - \left (\frac {a}{b}\right )^{\frac {1}{n}} \left (- \sqrt {\left (\cos {\left (\frac {\pi \left (2 k - 1\right )}{n} \right )} - 1\right ) \left (\cos {\left (\frac {\pi \left (2 k - 1\right )}{n} \right )} + 1\right )} + \cos {\left (\frac {2 \pi k}{n} - \frac {\pi }{n} \right )}\right ) \right )} - \left (\sqrt {\left (\cos {\left (\frac {\pi \left (2 k - 1\right )}{n} \right )} - 1\right ) \left (\cos {\left (\frac {\pi \left (2 k - 1\right )}{n} \right )} + 1\right )} + \cos {\left (\frac {2 \pi k}{n} - \frac {\pi }{n} \right )}\right ) \log {\left (x - \left (\frac {a}{b}\right )^{\frac {1}{n}} \left (\sqrt {\left (\cos {\left (\frac {\pi \left (2 k - 1\right )}{n} \right )} - 1\right ) \left (\cos {\left (\frac {\pi \left (2 k - 1\right )}{n} \right )} + 1\right )} + \cos {\left (\frac {2 \pi k}{n} - \frac {\pi }{n} \right )}\right ) \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.05, size = 202, normalized size = 1.77 \begin {gather*} -\cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right ) \log \left (-2 \, x \left (\frac {a}{b}\right )^{\left (\frac {1}{n}\right )} \cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right ) + x^{2} + \left (\frac {a}{b}\right )^{\frac {2}{n}}\right ) - \frac {2 \, {\left (\left (\frac {a}{b}\right )^{\left (\frac {1}{n}\right )} \cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right )^{2} - \left (\frac {a}{b}\right )^{\left (\frac {1}{n}\right )}\right )} \arctan \left (-\frac {\left (\frac {a}{b}\right )^{\left (\frac {1}{n}\right )} \cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right ) - x}{\sqrt {-\cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right )^{2} + 1} \left (\frac {a}{b}\right )^{\left (\frac {1}{n}\right )}}\right )}{\sqrt {-\cos \left (\frac {2 \, \pi k}{n} - \frac {\pi }{n}\right )^{2} + 1} \left (\frac {a}{b}\right )^{\left (\frac {1}{n}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.03, size = 178, normalized size = 1.56 \begin {gather*} -2\,\mathrm {atan}\left (\frac {2\,x\,\sqrt {1-{\cos \left (\frac {\Pi \,\left (2\,k-1\right )}{n}\right )}^2}-2\,\cos \left (\frac {\Pi \,\left (2\,k-1\right )}{n}\right )\,{\left (\frac {a}{b}\right )}^{1/n}\,\sqrt {1-{\cos \left (\frac {\Pi \,\left (2\,k-1\right )}{n}\right )}^2}}{2\,{\cos \left (\frac {\Pi \,\left (2\,k-1\right )}{n}\right )}^2\,{\left (\frac {a}{b}\right )}^{1/n}-2\,{\left (\frac {a}{b}\right )}^{1/n}}\right )\,\sqrt {1-{\cos \left (\frac {\Pi \,\left (2\,k-1\right )}{n}\right )}^2}-\cos \left (\frac {\Pi \,\left (2\,k-1\right )}{n}\right )\,\ln \left ({\left (\frac {a}{b}\right )}^{2/n}+x^2-2\,x\,\cos \left (\frac {\Pi \,\left (2\,k-1\right )}{n}\right )\,{\left (\frac {a}{b}\right )}^{1/n}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________